<template>
    <view>
        <block v-if="isshow=='y'">
            <view class="invitepplbox" v-if="istoggle" @click="gotopage">
                <image class="inviteimg" src="https://golfdate.oss-cn-shenzhen.aliyuncs.com/upload/1719991656137635.png" mode="widthFix"></image>
                <view class="invbtn">去邀请</view>
                <image class="clossimg" src="https://golfdate.oss-cn-shenzhen.aliyuncs.com/upload/1719970350537720.png" mode="widthFix" @click.stop="closebtn"></image>
            </view>
            <image @click="gotopage" v-else class="pplimg" src="https://golfdate.oss-cn-shenzhen.aliyuncs.com/upload/17199916362591343.png" mode="widthFix"></image>
        </block>
        
    </view>
</template>

<script>
export default {
components: {},
data() {
return {
    isshow:'y',
    istoggle:true,
};
},
created() {
	this.isshow = uni.getStorageSync('isShow') || 'y'
	console.log('===》》》》》》》》》',uni.getStorageSync('isShow'));
},
methods: {
	onxhsclose(){
		this.$refs.xhspopu.close();
	},
	idCopy(){
		let _this = this
		uni.setClipboardData({
			data: _this.item.XHSID,
			success: function () {
				_this.$pv.msg('复制成功');
			}
		});
	},
    closebtn(){
				this.isShow = 'n'
			  uni.setStorageSync('isShow', this.isShow);
			
        this.istoggle = !this.istoggle
        this.$store.commit('changeoffset', !this.istoggle);
        this.$emit('changeoffset',false);
    },
    gotopage(){
        let IsAuth = uni.getStorageSync('user').IsAuth
        if(IsAuth == 0){
            this.nav_to('/pages/start/start2')
        }else{
            this.nav_to('/pages/user/spread')
        }
    }
},

}
</script>
<style lang='scss'>
.invitepplbox{
	width: 694rpx;
	height: 72rpx;
	position: relative;
	margin: 20rpx auto;
	.inviteimg{
		width: 694rpx;
		height: 72rpx;
	}
	.clossimg{
		padding: 20rpx;
		position: absolute;
		top: 0;
		right: 2rpx;
		width: 32rpx;
		height: 32rpx;
	}
    .invbtn{
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 76rpx;
        width: 120rpx;
        height: 48rpx;
        background: #FFFFFF;
        border-radius: 24rpx;
        text-align: center;
        line-height: 48rpx;
        color: #FE4E53;
        font-size: 24rpx;
    }
}
.pplimg{
	width: 164rpx;
	height: 154rpx;
	position: fixed;
	right: 14rpx;
	bottom: 246rpx;
	z-index: 999;
}
</style>